/******店铺详情*******/
import { defineStore } from 'pinia'
import OrderDetails from '../pages/cleaningOrder/orderDetails.vue'
export const shopStore = defineStore('shopStore', {
  state: () => {
    return{
      shopInfo:{},
      placeOrderInfo:{},//下单信息
      addressInfo:{} ,//下单地址
      orderDetailsInfo:{},//订单详情

    }
  },
  actions: {
    setShopInfo(data){
      if (data) {
        console.log('信息的存在',data)
        this.shopInfo = Object.assign({}, this.shopInfo, data)
        console.log('信息的存在', this.shopInfo)
      }
    },
    setPlaceOrderInfo(data){
      console.log('下单信息',data)
      this.placeOrderInfo = Object.assign({}, this.placeOrderInfo, data)
    },
    setAddress(data){
      this.addressInfo = data
      console.log('下单地址',this.addressInfo)
    },
    setOrderDetailsInfo(data){
        this.orderDetailsInfo = data
    }
  },
  getters: {
    storeId(){
      return this.shopInfo.id
    }
  }
})
